<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>SWJTU Opensource Projects</title>
<style type="text/css">
	body{
		
		background:fefcea;
		font-family: Microsoft YaHei;
		font-size: 24px;
	}
	h3{
		font-size: 1.5em;
	}
	h5{
		font-family: Verdana;
		font-size: 1.2em;
	}
</style>
<link rel="stylesheet" type="text/css" href="../easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="../easyui/themes/icon.css">
<script type="text/javascript" src="../easyui/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="../easyui/jquery.easyui.min.js"></script>
<script type="text/javascript">
	var panels = undefined;	
	$(document).ready(function(){
		$.ajax({
			url:"/opensource/opensource/web/servlets/projects/ViewProjectsServlet",
			data:{test:1},
			type:"POST",
			contentType:"application/x-www-form-urlencoded",
			dataType:"text",
			success:function(data){
				var json = eval('(' +data+ ')');
				//for item in json, append a child in pContainer
				$("#pContainer").append("<div class='easyui-panel' id='i"+json[0].type+"' style='height:auto;'><h3>&nbsp"+json[0].type+"</h3><hr></div>");
				var tmp = json[0].type;
				for(var i=0;i<json.length;i++){
					if(json[i].type != tmp){
						$("#pContainer").append("<div class='easyui-panel' id='i"+json[i].type+"' style='height:auto;'><h3>&nbsp"+json[i].type+"</h3><hr></div>");
						tmp = json[i].type;
					}
					$("#i"+json[i].type).append("<h5><a>&nbsp"+json[i].name+"</a></h5>");
					$("#i"+json[i].type).append("<p>&nbsp发起人："+json[i].creator+"&nbsp&nbsp发起时间："+json[i].date+"</p>");
					$("#i"+json[i].type).append("<p>&nbsp&nbsp&nbsp&nbsp"+json[i].brief+"&nbsp&nbsp<a href='#'>申请加入</a></p><hr>");
					//alert(aa.attr('id'));
				}
			},
			failed:function(){
				alert('error');	
			}
		});// end of ajax
	});// end of ready function
</script>
</head>

<body>
	<div id="pContainer" class="easyui-panel" title="开源项目列表"></div>
</body>
</html>